package bairui.international.model.domain.jpa;

import com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue;

/**
 *
 * (产品)TB_Product
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_Product#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate

@javax.persistence.Entity(name="t_product")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("产品")
@com.lianjing.sh.processing.info.annotation.InfoComment("产品")
public class TB_Product
 extends TBSuper_BaseIDAndTimeAndOrderValue
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 代码 */
		public String getNumber();
		/** 名称 */
		public String getName();
		/** 价格 */
		public Double getPrice();
		/** 产品分类 */
		public bairui.international.model.domain.jpa.TB_ProductCategory getProductCategory();
		/** 状态 */
		public bairui.international.model.status.State_Product getState();
		/** 产品根分类 */
		public bairui.international.model.domain.jpa.TB_ProductCategory getRootCategory();
		/** 积分 */
		public Double getScore();
		/** 分成比率[%] */
		public Double getDivideRate();
		/** 兑换积分值 */
		public Double getExchange();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_Product properties(MustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPrice(properties.getPrice());
		this.setProductCategory(properties.getProductCategory());
		this.setState(properties.getState());
		this.setRootCategory(properties.getRootCategory());
		this.setScore(properties.getScore());
		this.setDivideRate(properties.getDivideRate());
		this.setExchange(properties.getExchange());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_Product(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 尊享价 */
		public Double getShowPrice();
		/** 备注 */
		public String getComment();
		/** 详情 */
		public String getDetail();
		/** 图片 */
		public String getImgUrl();
		/** 酒瓶规格_酒 */
		public bairui.international.model.domain.jpa.TB_WineBottleNorms getWineBottleNormsWine();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_Product properties(OptionalSingleProperties properties) {
		this.setShowPrice(properties.getShowPrice());
		this.setComment(properties.getComment());
		this.setDetail(properties.getDetail());
		this.setImgUrl(properties.getImgUrl());
		this.setWineBottleNormsWine(properties.getWineBottleNormsWine());
		return this;
	}
	
	
	
	public TB_Product(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 代码 */
		public String getNumber();
		/** 名称 */
		public String getName();
		/** 价格 */
		public Double getPrice();
		/** 产品分类 */
		public bairui.international.model.domain.jpa.TB_ProductCategory getProductCategory();
		/** 状态 */
		public bairui.international.model.status.State_Product getState();
		/** 产品根分类 */
		public bairui.international.model.domain.jpa.TB_ProductCategory getRootCategory();
		/** 积分 */
		public Double getScore();
		/** 分成比率[%] */
		public Double getDivideRate();
		/** 兑换积分值 */
		public Double getExchange();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_Product properties(CurrentMustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPrice(properties.getPrice());
		this.setProductCategory(properties.getProductCategory());
		this.setState(properties.getState());
		this.setRootCategory(properties.getRootCategory());
		this.setScore(properties.getScore());
		this.setDivideRate(properties.getDivideRate());
		this.setExchange(properties.getExchange());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 尊享价 */
		public Double getShowPrice();
		/** 备注 */
		public String getComment();
		/** 详情 */
		public String getDetail();
		/** 图片 */
		public String getImgUrl();
		/** 酒瓶规格_酒 */
		public bairui.international.model.domain.jpa.TB_WineBottleNorms getWineBottleNormsWine();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_Product properties(CurrentOptionalSingleProperties properties) {
		this.setShowPrice(properties.getShowPrice());
		this.setComment(properties.getComment());
		this.setDetail(properties.getDetail());
		this.setImgUrl(properties.getImgUrl());
		this.setWineBottleNormsWine(properties.getWineBottleNormsWine());
		return this;
	}
	
	public TB_Product(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_Product(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean
	) {
		update(bean);
	}
	
	public TB_Product update(com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_Product.this);
			if(isOverride_getOrderValue){
				TB_Product.this.setOrderValue(orderValue);
			}
	
			String number = getNumber(TB_Product.this);
			if(isOverride_getNumber){
				TB_Product.this.setNumber(number);
			}
	
			String name = getName(TB_Product.this);
			if(isOverride_getName){
				TB_Product.this.setName(name);
			}
	
			Double price = getPrice(TB_Product.this);
			if(isOverride_getPrice){
				TB_Product.this.setPrice(price);
			}
	
			Double showPrice = getShowPrice(TB_Product.this);
			if(isOverride_getShowPrice){
				TB_Product.this.setShowPrice(showPrice);
			}
	
			String comment = getComment(TB_Product.this);
			if(isOverride_getComment){
				TB_Product.this.setComment(comment);
			}
	
			String detail = getDetail(TB_Product.this);
			if(isOverride_getDetail){
				TB_Product.this.setDetail(detail);
			}
	
			bairui.international.model.domain.jpa.TB_ProductCategory productCategory = getProductCategory(TB_Product.this);
			if(isOverride_getProductCategory){
				TB_Product.this.setProductCategory(productCategory);
			}
	
			bairui.international.model.status.State_Product state = getState(TB_Product.this);
			if(isOverride_getState){
				TB_Product.this.setState(state);
			}
	
			String imgUrl = getImgUrl(TB_Product.this);
			if(isOverride_getImgUrl){
				TB_Product.this.setImgUrl(imgUrl);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductRollImage> productRollImages = getProductRollImages(TB_Product.this);
			if(isOverride_getProductRollImages){
				TB_Product.this.setProductRollImages(productRollImages);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductPropertyItem> productPropertyItems = getProductPropertyItems(TB_Product.this);
			if(isOverride_getProductPropertyItems){
				TB_Product.this.setProductPropertyItems(productPropertyItems);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems = getProductOrderItems(TB_Product.this);
			if(isOverride_getProductOrderItems){
				TB_Product.this.setProductOrderItems(productOrderItems);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_IndexModuleProduct> indexModuleProducts = getIndexModuleProducts(TB_Product.this);
			if(isOverride_getIndexModuleProducts){
				TB_Product.this.setIndexModuleProducts(indexModuleProducts);
			}
	
			bairui.international.model.domain.jpa.TB_ProductCategory rootCategory = getRootCategory(TB_Product.this);
			if(isOverride_getRootCategory){
				TB_Product.this.setRootCategory(rootCategory);
			}
	
			Double score = getScore(TB_Product.this);
			if(isOverride_getScore){
				TB_Product.this.setScore(score);
			}
	
			bairui.international.model.domain.jpa.TB_WineBottleNorms wineBottleNormsWine = getWineBottleNormsWine(TB_Product.this);
			if(isOverride_getWineBottleNormsWine){
				TB_Product.this.setWineBottleNormsWine(wineBottleNormsWine);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_WineBottleNorms> wineBottleNormsWrap = getWineBottleNormsWrap(TB_Product.this);
			if(isOverride_getWineBottleNormsWrap){
				TB_Product.this.setWineBottleNormsWrap(wineBottleNormsWrap);
			}
	
			Double divideRate = getDivideRate(TB_Product.this);
			if(isOverride_getDivideRate){
				TB_Product.this.setDivideRate(divideRate);
			}
	
			Double exchange = getExchange(TB_Product.this);
			if(isOverride_getExchange){
				TB_Product.this.setExchange(exchange);
			}
		}
	
		public TB_Product up(){
			return TB_Product.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_Product it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 代码 */
		private boolean isOverride_getNumber = true;
		public String getNumber(TB_Product it) throws Exception { 
			isOverride_getNumber = false; 
			return null;
		}
		/** 名称 */
		private boolean isOverride_getName = true;
		public String getName(TB_Product it) throws Exception { 
			isOverride_getName = false; 
			return null;
		}
		/** 价格 */
		private boolean isOverride_getPrice = true;
		public Double getPrice(TB_Product it) throws Exception { 
			isOverride_getPrice = false; 
			return null;
		}
		/** 尊享价 */
		private boolean isOverride_getShowPrice = true;
		public Double getShowPrice(TB_Product it) throws Exception { 
			isOverride_getShowPrice = false; 
			return null;
		}
		/** 备注 */
		private boolean isOverride_getComment = true;
		public String getComment(TB_Product it) throws Exception { 
			isOverride_getComment = false; 
			return null;
		}
		/** 详情 */
		private boolean isOverride_getDetail = true;
		public String getDetail(TB_Product it) throws Exception { 
			isOverride_getDetail = false; 
			return null;
		}
		/** 产品分类 */
		private boolean isOverride_getProductCategory = true;
		public bairui.international.model.domain.jpa.TB_ProductCategory getProductCategory(TB_Product it) throws Exception { 
			isOverride_getProductCategory = false; 
			return null;
		}
		/** 状态 */
		private boolean isOverride_getState = true;
		public bairui.international.model.status.State_Product getState(TB_Product it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 图片 */
		private boolean isOverride_getImgUrl = true;
		public String getImgUrl(TB_Product it) throws Exception { 
			isOverride_getImgUrl = false; 
			return null;
		}
		/** 产品滚动图片 */
		private boolean isOverride_getProductRollImages = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductRollImage> getProductRollImages(TB_Product it) throws Exception { 
			isOverride_getProductRollImages = false; 
			return null;
		}
		/** 产品属性项 */
		private boolean isOverride_getProductPropertyItems = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductPropertyItem> getProductPropertyItems(TB_Product it) throws Exception { 
			isOverride_getProductPropertyItems = false; 
			return null;
		}
		/** 产品订单项 */
		private boolean isOverride_getProductOrderItems = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> getProductOrderItems(TB_Product it) throws Exception { 
			isOverride_getProductOrderItems = false; 
			return null;
		}
		/** 首页模块产品 */
		private boolean isOverride_getIndexModuleProducts = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_IndexModuleProduct> getIndexModuleProducts(TB_Product it) throws Exception { 
			isOverride_getIndexModuleProducts = false; 
			return null;
		}
		/** 产品根分类 */
		private boolean isOverride_getRootCategory = true;
		public bairui.international.model.domain.jpa.TB_ProductCategory getRootCategory(TB_Product it) throws Exception { 
			isOverride_getRootCategory = false; 
			return null;
		}
		/** 积分 */
		private boolean isOverride_getScore = true;
		public Double getScore(TB_Product it) throws Exception { 
			isOverride_getScore = false; 
			return null;
		}
		/** 酒瓶规格_酒 */
		private boolean isOverride_getWineBottleNormsWine = true;
		public bairui.international.model.domain.jpa.TB_WineBottleNorms getWineBottleNormsWine(TB_Product it) throws Exception { 
			isOverride_getWineBottleNormsWine = false; 
			return null;
		}
		/** 酒瓶规格_包装 */
		private boolean isOverride_getWineBottleNormsWrap = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_WineBottleNorms> getWineBottleNormsWrap(TB_Product it) throws Exception { 
			isOverride_getWineBottleNormsWrap = false; 
			return null;
		}
		/** 分成比率[%] */
		private boolean isOverride_getDivideRate = true;
		public Double getDivideRate(TB_Product it) throws Exception { 
			isOverride_getDivideRate = false; 
			return null;
		}
		/** 兑换积分值 */
		private boolean isOverride_getExchange = true;
		public Double getExchange(TB_Product it) throws Exception { 
			isOverride_getExchange = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_Product() {
	}
	
	public TB_Product(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_Product(
		@lombok.NonNull TB_Product bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setNumber(bean.getNumber());
		this.setName(bean.getName());
		this.setPrice(bean.getPrice());
		this.setShowPrice(bean.getShowPrice());
		this.setComment(bean.getComment());
		this.setDetail(bean.getDetail());
		this.setProductCategory(bean.getProductCategory());
		this.setCreator(bean.getCreator());
		this.setLastModifier(bean.getLastModifier());
		this.setState(bean.getState());
		this.setImgUrl(bean.getImgUrl());
		this.setProductRollImages(bean.getProductRollImages());
		this.setProductPropertyItems(bean.getProductPropertyItems());
		this.setProductOrderItems(bean.getProductOrderItems());
		this.setIndexModuleProducts(bean.getIndexModuleProducts());
		this.setRootCategory(bean.getRootCategory());
		this.setScore(bean.getScore());
		this.setWineBottleNormsWine(bean.getWineBottleNormsWine());
		this.setWineBottleNormsWrap(bean.getWineBottleNormsWrap());
		this.setDivideRate(bean.getDivideRate());
		this.setExchange(bean.getExchange());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("代码")
	@com.lianjing.sh.processing.info.annotation.InfoComment("代码")
	@javax.persistence.Column(name="number", unique=true, nullable=false, length=32)
	private String number;

	@com.lianjing.sh.model.common.annotation.Comment("名称")
	@com.lianjing.sh.processing.info.annotation.InfoComment("名称")
	@javax.persistence.Column(name="name", nullable=false, length=255)
	private String name;

	@com.lianjing.sh.model.common.annotation.Comment("价格")
	@com.lianjing.sh.processing.info.annotation.InfoComment("价格")
	@javax.persistence.Column(name="price", nullable=false)
	private Double price;

	@com.lianjing.sh.model.common.annotation.Comment("尊享价")
	@com.lianjing.sh.processing.info.annotation.InfoComment("尊享价")
	@javax.persistence.Column(name="showPrice")
	private Double showPrice;

	@com.lianjing.sh.model.common.annotation.Comment("备注")
	@com.lianjing.sh.processing.info.annotation.InfoComment("备注")
	@javax.persistence.Column(name="comment", length=500)
	private String comment;

	@com.lianjing.sh.model.common.annotation.Comment("详情")
	@com.lianjing.sh.processing.info.annotation.InfoComment("详情")
	@javax.persistence.Lob
	@javax.persistence.Column(name="detail", length=20000)
	private String detail;

	@com.lianjing.sh.model.common.annotation.Comment("产品分类")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品分类")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_ProductCategory productCategory;

	@com.lianjing.sh.model.common.annotation.Comment("创建者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("创建者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="creator_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin creator;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	@com.lianjing.sh.model.common.annotation.Comment("状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private bairui.international.model.status.State_Product state;

	@com.lianjing.sh.model.common.annotation.Comment("图片")
	@com.lianjing.sh.processing.info.annotation.InfoComment("图片")
	@javax.persistence.Column(name="imgUrl", length=500)
	private String imgUrl;

	@com.lianjing.sh.model.common.annotation.Comment("产品滚动图片")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品滚动图片")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="product")
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductRollImage> productRollImages;

	@com.lianjing.sh.model.common.annotation.Comment("产品属性项")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品属性项")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany()
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductPropertyItem> productPropertyItems;

	@com.lianjing.sh.model.common.annotation.Comment("产品订单项")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单项")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="product")
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems;

	@com.lianjing.sh.model.common.annotation.Comment("首页模块产品")
	@com.lianjing.sh.processing.info.annotation.InfoComment("首页模块产品")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="product")
	private java.util.List<bairui.international.model.domain.jpa.TB_IndexModuleProduct> indexModuleProducts;

	@com.lianjing.sh.model.common.annotation.Comment("产品根分类")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品根分类")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_ProductCategory rootCategory;

	@com.lianjing.sh.model.common.annotation.Comment("积分")
	@com.lianjing.sh.processing.info.annotation.InfoComment("积分")
	@javax.persistence.Column(name="score", nullable=false)
	private Double score;

	@com.lianjing.sh.model.common.annotation.Comment("酒瓶规格_酒")
	@com.lianjing.sh.processing.info.annotation.InfoComment("酒瓶规格_酒")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_WineBottleNorms wineBottleNormsWine;

	@com.lianjing.sh.model.common.annotation.Comment("酒瓶规格_包装")
	@com.lianjing.sh.processing.info.annotation.InfoComment("酒瓶规格_包装")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToMany()
	private java.util.List<bairui.international.model.domain.jpa.TB_WineBottleNorms> wineBottleNormsWrap;

	@com.lianjing.sh.model.common.annotation.Comment("分成比率[%]")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分成比率[%]")
	@javax.persistence.Column(name="divideRate", nullable=false)
	private Double divideRate;

	@com.lianjing.sh.model.common.annotation.Comment("兑换积分值")
	@com.lianjing.sh.processing.info.annotation.InfoComment("兑换积分值")
	@javax.persistence.Column(name="exchange", nullable=false)
	private Double exchange;

	/** get[代码] */
	public String getNumber() {
		return this.number;
	}

	/** get[名称] */
	public String getName() {
		return this.name;
	}

	/** get[价格] */
	public Double getPrice() {
		return this.price;
	}

	/** get[尊享价] */
	public Double getShowPrice() {
		return this.showPrice;
	}

	/** get[备注] */
	public String getComment() {
		return this.comment;
	}

	/** get[详情] */
	public String getDetail() {
		return this.detail;
	}

	/** get[产品分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory getProductCategory() {
		return this.productCategory;
	}

	/** get[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin getCreator() {
		return this.creator;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** get[状态] */
	public bairui.international.model.status.State_Product getState() {
		return this.state;
	}

	/** get[图片] */
	public String getImgUrl() {
		return this.imgUrl;
	}

	/** get[产品滚动图片] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductRollImage> getProductRollImages() {
		return this.productRollImages;
	}

	/** get[产品属性项] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductPropertyItem> getProductPropertyItems() {
		return this.productPropertyItems;
	}

	/** get[产品订单项] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> getProductOrderItems() {
		return this.productOrderItems;
	}

	/** get[首页模块产品] */
	public java.util.List<bairui.international.model.domain.jpa.TB_IndexModuleProduct> getIndexModuleProducts() {
		return this.indexModuleProducts;
	}

	/** get[产品根分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory getRootCategory() {
		return this.rootCategory;
	}

	/** get[积分] */
	public Double getScore() {
		return this.score;
	}

	/** get[酒瓶规格_酒] */
	public bairui.international.model.domain.jpa.TB_WineBottleNorms getWineBottleNormsWine() {
		return this.wineBottleNormsWine;
	}

	/** get[酒瓶规格_包装] */
	public java.util.List<bairui.international.model.domain.jpa.TB_WineBottleNorms> getWineBottleNormsWrap() {
		return this.wineBottleNormsWrap;
	}

	/** get[分成比率[%]] */
	public Double getDivideRate() {
		return this.divideRate;
	}

	/** get[兑换积分值] */
	public Double getExchange() {
		return this.exchange;
	}

	/** set[代码] */
	public void setNumber(String number) {
		this.number = number;
	}

	/** set[名称] */
	public void setName(String name) {
		this.name = name;
	}

	/** set[价格] */
	public void setPrice(Double price) {
		this.price = price;
	}

	/** set[尊享价] */
	public void setShowPrice(Double showPrice) {
		this.showPrice = showPrice;
	}

	/** set[备注] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** set[详情] */
	public void setDetail(String detail) {
		this.detail = detail;
	}

	/** set[产品分类] */
	public void setProductCategory(bairui.international.model.domain.jpa.TB_ProductCategory productCategory) {
		this.productCategory = productCategory;
	}

	/** set[创建者] */
	public void setCreator(bairui.international.model.domain.jpa.TB_Admin creator) {
		this.creator = creator;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}

	/** set[状态] */
	public void setState(bairui.international.model.status.State_Product state) {
		this.state = state;
	}

	/** set[图片] */
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	/** set[产品滚动图片] */
	public void setProductRollImages(java.util.List<bairui.international.model.domain.jpa.TB_ProductRollImage> productRollImages) {
		this.productRollImages = productRollImages;
	}

	/** set[产品属性项] */
	public void setProductPropertyItems(java.util.List<bairui.international.model.domain.jpa.TB_ProductPropertyItem> productPropertyItems) {
		this.productPropertyItems = productPropertyItems;
	}

	/** set[产品订单项] */
	public void setProductOrderItems(java.util.List<bairui.international.model.domain.jpa.TB_ProductOrderItem> productOrderItems) {
		this.productOrderItems = productOrderItems;
	}

	/** set[首页模块产品] */
	public void setIndexModuleProducts(java.util.List<bairui.international.model.domain.jpa.TB_IndexModuleProduct> indexModuleProducts) {
		this.indexModuleProducts = indexModuleProducts;
	}

	/** set[产品根分类] */
	public void setRootCategory(bairui.international.model.domain.jpa.TB_ProductCategory rootCategory) {
		this.rootCategory = rootCategory;
	}

	/** set[积分] */
	public void setScore(Double score) {
		this.score = score;
	}

	/** set[酒瓶规格_酒] */
	public void setWineBottleNormsWine(bairui.international.model.domain.jpa.TB_WineBottleNorms wineBottleNormsWine) {
		this.wineBottleNormsWine = wineBottleNormsWine;
	}

	/** set[酒瓶规格_包装] */
	public void setWineBottleNormsWrap(java.util.List<bairui.international.model.domain.jpa.TB_WineBottleNorms> wineBottleNormsWrap) {
		this.wineBottleNormsWrap = wineBottleNormsWrap;
	}

	/** set[分成比率[%]] */
	public void setDivideRate(Double divideRate) {
		this.divideRate = divideRate;
	}

	/** set[兑换积分值] */
	public void setExchange(Double exchange) {
		this.exchange = exchange;
	}

	public void assignProductCategory(bairui.international.model.domain.jpa.TB_ProductCategory productCategory) {
		if(null != productCategory){
			productCategory.addProducts(this);
		}
		this.setProductCategory(productCategory);
	}
	







	public void assignRootCategory(bairui.international.model.domain.jpa.TB_ProductCategory rootCategory) {
		if(null != rootCategory){
			rootCategory.addRootCategoryProdcuts(this);
		}
		this.setRootCategory(rootCategory);
	}
	

	public void assignWineBottleNormsWine(bairui.international.model.domain.jpa.TB_WineBottleNorms wineBottleNormsWine) {
		if(null != wineBottleNormsWine){
			wineBottleNormsWine.addWines(this);
		}
		this.setWineBottleNormsWine(wineBottleNormsWine);
	}
	


	/** add[ProductRollImages] */
	public TB_Product addProductRollImages(bairui.international.model.domain.jpa.TB_ProductRollImage ... productRollImages){
		if(this.productRollImages == null){
			this.productRollImages = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductRollImage bean : productRollImages){
			bean.setProduct(this);
			this.productRollImages.add(bean);
		}
		return this;
	}
	/** add[ProductPropertyItems] */
	public TB_Product addProductPropertyItems(bairui.international.model.domain.jpa.TB_ProductPropertyItem ... productPropertyItems){
		if(this.productPropertyItems == null){
			this.productPropertyItems = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductPropertyItem bean : productPropertyItems){
			this.productPropertyItems.add(bean);
		}
		return this;
	}
	/** add[ProductOrderItems] */
	public TB_Product addProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null){
			this.productOrderItems = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderItem bean : productOrderItems){
			bean.setProduct(this);
			this.productOrderItems.add(bean);
		}
		return this;
	}
	/** add[IndexModuleProducts] */
	public TB_Product addIndexModuleProducts(bairui.international.model.domain.jpa.TB_IndexModuleProduct ... indexModuleProducts){
		if(this.indexModuleProducts == null){
			this.indexModuleProducts = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_IndexModuleProduct bean : indexModuleProducts){
			bean.setProduct(this);
			this.indexModuleProducts.add(bean);
		}
		return this;
	}
	/** add[WineBottleNormsWrap] */
	public TB_Product addWineBottleNormsWrap(bairui.international.model.domain.jpa.TB_WineBottleNorms ... wineBottleNormsWrap){
		if(this.wineBottleNormsWrap == null){
			this.wineBottleNormsWrap = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_WineBottleNorms bean : wineBottleNormsWrap){
			this.wineBottleNormsWrap.add(bean);
		}
		return this;
	}
	
	/** remove[ProductRollImages] */
	public TB_Product removeProductRollImages(bairui.international.model.domain.jpa.TB_ProductRollImage ... productRollImages){
		if(this.productRollImages == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductRollImage bean : productRollImages){
			bean.setProduct(null);
			this.productRollImages.remove(bean);
		}
		return this;
	}
	/** remove[ProductPropertyItems] */
	public TB_Product removeProductPropertyItems(bairui.international.model.domain.jpa.TB_ProductPropertyItem ... productPropertyItems){
		if(this.productPropertyItems == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductPropertyItem bean : productPropertyItems){
			this.productPropertyItems.remove(bean);
		}
		return this;
	}
	/** remove[ProductOrderItems] */
	public TB_Product removeProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrderItem bean : productOrderItems){
			bean.setProduct(null);
			this.productOrderItems.remove(bean);
		}
		return this;
	}
	/** remove[IndexModuleProducts] */
	public TB_Product removeIndexModuleProducts(bairui.international.model.domain.jpa.TB_IndexModuleProduct ... indexModuleProducts){
		if(this.indexModuleProducts == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_IndexModuleProduct bean : indexModuleProducts){
			bean.setProduct(null);
			this.indexModuleProducts.remove(bean);
		}
		return this;
	}
	/** remove[WineBottleNormsWrap] */
	public TB_Product removeWineBottleNormsWrap(bairui.international.model.domain.jpa.TB_WineBottleNorms ... wineBottleNormsWrap){
		if(this.wineBottleNormsWrap == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_WineBottleNorms bean : wineBottleNormsWrap){
			this.wineBottleNormsWrap.remove(bean);
		}
		return this;
	}
	
	/**
	 * contains[ProductRollImages]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductRollImages(bairui.international.model.domain.jpa.TB_ProductRollImage ... productRollImages){
		if(this.productRollImages == null || productRollImages==null || productRollImages.length<=0){
			return false;
		}
		return this.productRollImages.containsAll(java.util.Arrays.asList(productRollImages));
	}
	/**
	 * contains[ProductPropertyItems]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductPropertyItems(bairui.international.model.domain.jpa.TB_ProductPropertyItem ... productPropertyItems){
		if(this.productPropertyItems == null || productPropertyItems==null || productPropertyItems.length<=0){
			return false;
		}
		return this.productPropertyItems.containsAll(java.util.Arrays.asList(productPropertyItems));
	}
	/**
	 * contains[ProductOrderItems]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductOrderItems(bairui.international.model.domain.jpa.TB_ProductOrderItem ... productOrderItems){
		if(this.productOrderItems == null || productOrderItems==null || productOrderItems.length<=0){
			return false;
		}
		return this.productOrderItems.containsAll(java.util.Arrays.asList(productOrderItems));
	}
	/**
	 * contains[IndexModuleProducts]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsIndexModuleProducts(bairui.international.model.domain.jpa.TB_IndexModuleProduct ... indexModuleProducts){
		if(this.indexModuleProducts == null || indexModuleProducts==null || indexModuleProducts.length<=0){
			return false;
		}
		return this.indexModuleProducts.containsAll(java.util.Arrays.asList(indexModuleProducts));
	}
	/**
	 * contains[WineBottleNormsWrap]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsWineBottleNormsWrap(bairui.international.model.domain.jpa.TB_WineBottleNorms ... wineBottleNormsWrap){
		if(this.wineBottleNormsWrap == null || wineBottleNormsWrap==null || wineBottleNormsWrap.length<=0){
			return false;
		}
		return this.wineBottleNormsWrap.containsAll(java.util.Arrays.asList(wineBottleNormsWrap));
	}
	

	/** take[产品分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory takeProductCategory(){
		if(null == this.productCategory){
			this.productCategory = new bairui.international.model.domain.jpa.TB_ProductCategory();
		}
		return this.productCategory;
	}
	
	/** take[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin takeCreator(){
		if(null == this.creator){
			this.creator = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.creator;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	/** take[产品根分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory takeRootCategory(){
		if(null == this.rootCategory){
			this.rootCategory = new bairui.international.model.domain.jpa.TB_ProductCategory();
		}
		return this.rootCategory;
	}
	
	/** take[酒瓶规格_酒] */
	public bairui.international.model.domain.jpa.TB_WineBottleNorms takeWineBottleNormsWine(){
		if(null == this.wineBottleNormsWine){
			this.wineBottleNormsWine = new bairui.international.model.domain.jpa.TB_WineBottleNorms();
		}
		return this.wineBottleNormsWine;
	}
	
	/** must[产品分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory mustProductCategory() {
		return this.productCategory;
	}
	
	/** must[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin mustCreator() {
		return this.creator;
	}
	
	/** must[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin mustLastModifier() {
		return this.lastModifier;
	}
	
	/** must[产品根分类] */
	public bairui.international.model.domain.jpa.TB_ProductCategory mustRootCategory() {
		return this.rootCategory;
	}
	
	/** optional[酒瓶规格_酒] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_WineBottleNorms> optionalWineBottleNormsWine() {
		return java.util.Optional.ofNullable(this.wineBottleNormsWine);
	}
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_Product other = (TB_Product) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		String name = this.getName();
		if(null != name){
			return String.valueOf(name);
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setCreator((bairui.international.model.domain.jpa.TB_Admin)user);
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public bairui.international.model.status.State_Product state(){
		return this.getState();
	}


}
